/*************************************************************************
> File Name: adapter_func_pointer.cpp
> Author: hzy
> Created Time: 2023-08-19 15:05:16
> Description:
************************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

void PrintVectorInt(int num1)
{
    cout << "num1 = " << num1 << endl;
}

void myPrintVectorInt(int num1, int num2)
{
    cout << "num1 = " << num1 << ", num2 = " << num2 << endl;
}

void test01()
{
    vector<int> v;
    for (int i = 1; i <= 5; i++)
    {
        v.push_back(i);
    }

    for_each(v.begin(), v.end(), ptr_fun(PrintVectorInt));
    cout << "=========================" << endl;
    for_each(v.begin(), v.end(), bind1st(ptr_fun(myPrintVectorInt), 55));
    cout << "=========================" << endl;
    for_each(v.begin(), v.end(), bind2nd(ptr_fun(myPrintVectorInt), 66));
}

int main()
{
    test01();

    return 0;
}